@svizzle/utils/[string-boolean]-[object-boolean]

Methods

(static) hasKeyWith() → {function}

Source:
Since:
  • 0.20.0

Return a function expecting an object and returning true if the input object has a key satisfying the provided predicate

Example
> hasA = hasKeyWith(_.is('a'))
> hasA({a: 2, b: 4, c: 3})
true
> hasA({b: 4, c: 3})
false
Parameters:
Type Description
predicate
Returns:
  • Object -> Boolean
Type
function